test(witness): pin shape-gate boundaries so a relaxed bound can't accept malformed witnesses (#4)#127
Merged
Merged
Conversation
β¦ accept malformed witnesses (#4) Beta feedback #4 (mutation finding): verifyWitness's shape gate uses EXACT checks β public_key.length === 64, signature.length === 128, schema === 1. The existing tests only cover UNDER-length keys/sigs ('short') and schema 999, so a boundary mutant that relaxes `!== 64` β `< 64` (or `!== 1` β `> 1`) would accept OVER-length keys/sigs and schema 0/negative and survive the suite. Adds boundary tests pinning the other side of each bound: - an over-length public_key (65) is rejected, - an over-length signature (129) is rejected, - schema 0 and schema -1 are rejected. Verified: the over-length-key test FAILS under `!== 64` β `< 64`, and the schema test FAILS under `!== 1` β `> 1`; both pass on the real code (then reverted). Test-only; no behaviour change. Full create-agent-harness suite 384/384; tsc clean. Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / why
Closes the last mutation-surfaced test gap from the AQE beta feedback (#4).
verifyWitness's shape gate uses exact checks βpublic_key.length === 64,signature.length === 128,schema === 1β but the existing tests only cover under-length keys/sigs ('short') andschema: 999. So a boundary mutant that relaxes!== 64β< 64(or!== 1β> 1) would accept over-length keys/sigs and schema 0/negative and survive the suite.Change (test-only)
Pins the other side of each boundary:
public_key(65 chars) is rejectedsignature(129 chars) is rejectedschema0 and -1 are rejectedMutation-kill verified
The over-length-key test fails under
!== 64β< 64; the schema test fails under!== 1β> 1; both pass on the real code. (Verified locally, then reverted.)Tests
Full
create-agent-harnesssuite 384/384;tscclean. No behaviour change. This completes the #4 mutation-guard set (mcp-scan severity #125, renderer charset #126, witness bounds here).π€ Generated with claude-flow